#ifndef _MSN_SESSION_H
#define _MSN_SESSION_H
#include <glib.h>
#include "msn_user.h"
#define MSN_NOTIFY_SERVER "messenger.hotmail.com"

typedef struct {
	int fd;
	int port;
	event_t *ev;
	event_t *timer;
	struct in_addr addr;
	GString *in;
}msn_ns_t;

typedef struct {
	/* login name and password */
	GString *name; 
	GString *pass;
	int connected;
	int logined;
	int tr_id;
	
	msn_user_t *owner;
	/* index all friends, data type is msn_user_t */
	GHashTable *friends;
	GList *switchs;
	/* Some information about auth */
	GString *nonce;
	GList *sec_tokens;
	msn_ns_t *ns;
	SSL *ssl;
}msn_session_t;

extern msn_ns_t *msn_ns_new(int fd, int port, struct in_addr addr);
extern void msn_ns_clean(msn_ns_t *ns);
/* msn session functions */
extern msn_session_t *msn_session_new(const char *name, const char *pass);
extern void msn_session_clean(msn_session_t *ms);
#endif
